#ifndef WORKHOLDERSTATE_H
#define WORKHOLDERSTATE_H

#include "configManager/configobject.h"

class WorkHolderState : public ConfigObject
{
    Q_OBJECT

    Q_PROPERTY(bool dispWHHasTray READ dispWHHasTray WRITE setDispWHHasTray NOTIFY dispWHHasTrayChanged)
    Q_PROPERTY(bool dispWHTrayHasDoneWork READ dispWHTrayHasDoneWork WRITE setDispWHTrayHasDoneWork NOTIFY
                   dispWHTrayHasDoneWorkChanged)
    Q_PROPERTY(bool bonderWHHasTray READ bonderWHHasTray WRITE setBonderWHHasTray NOTIFY bonderWHHasTrayChanged)

public:
    WorkHolderState(QObject *parent = nullptr) : ConfigObject(parent)
    {
        init();
    }

    bool dispWHHasTray() const
    {
        return m_dispWHHasTray;
    }

    bool bonderWHHasTray() const
    {
        return m_bonderWHHasTray;
    }

    bool dispWHTrayHasDoneWork() const
    {
        return m_dispWHTrayHasDoneWork;
    }

public slots:
    void setDispWHHasTray(bool dispWHHasTray)
    {
        if (m_dispWHHasTray == dispWHHasTray)
            return;

        m_dispWHHasTray = dispWHHasTray;
        emit dispWHHasTrayChanged(m_dispWHHasTray);
    }

    void setBonderWHHasTray(bool bonderWHHasTray)
    {
        if (m_bonderWHHasTray == bonderWHHasTray)
            return;

        m_bonderWHHasTray = bonderWHHasTray;
        emit bonderWHHasTrayChanged(m_bonderWHHasTray);
    }

    void setDispWHTrayHasDoneWork(bool dispWHTrayHasDoneWork)
    {
        if (m_dispWHTrayHasDoneWork == dispWHTrayHasDoneWork)
            return;

        m_dispWHTrayHasDoneWork = dispWHTrayHasDoneWork;
        emit dispWHTrayHasDoneWorkChanged(m_dispWHTrayHasDoneWork);
    }

signals:
    void dispWHHasTrayChanged(bool dispWHHasTray);

    void bonderWHHasTrayChanged(bool bonderWHHasTray);

    void dispWHTrayHasDoneWorkChanged(bool dispWHTrayHasDoneWork);

private:
    bool m_dispWHHasTray = false;
    bool m_bonderWHHasTray = false;
    bool m_dispWHTrayHasDoneWork = false;
};

#endif    // WORKHOLDERSTATE_H
